package com.hbpu.encap.homework02;

public class Homework04 {
    public static void main(String[] args) {
        Cellphone cellphone = new Cellphone();
        cellphone.testWork(new Calculate() {
            @Override
            public void work() {
                System.out.println("计算功能");
            }
        });

    }
}

interface Calculate {
    void work();
}

class Cellphone {
    public void testWork(Calculate calculate) {
        calculate.work();
    }
}